package net.zoneland.knowledge.controller.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import lombok.Data;
import net.zoneland.knowledge.model.LoginUserPojo;
import net.zoneland.knowledge.utils.DateHelper;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDate;
import java.util.List;

/**
 * 三会一课参数对象.
 * @author zouxia
 */
@Data
public class SanHuiYiKeVo extends Page implements Serializable {
    private static final long serialVersionUID = -8017556974880541076L;

    /**
     * 会议名称.
     */
    private String meetingName;

    /**
     * 关键字.
     */
    private String issueRecord;

    /**
     * 会议开始时间.
     */
    @DateTimeFormat(pattern = DateHelper.DEFAULT_DATE_FORMAT)
    @JsonFormat(pattern = DateHelper.DEFAULT_DATE_FORMAT, timezone = "GMT+8")
    @JsonDeserialize(using = LocalDateDeserializer.class)		// 反序列化
    @JsonSerialize(using = LocalDateSerializer.class)		// 序列化
    private LocalDate meetingStartTime;

    /**
     * 会议结束时间.
     */
    @DateTimeFormat(pattern = DateHelper.DEFAULT_DATE_FORMAT)
    @JsonFormat(pattern = DateHelper.DEFAULT_DATE_FORMAT, timezone = "GMT+8")
    @JsonDeserialize(using = LocalDateDeserializer.class)		// 反序列化
    @JsonSerialize(using = LocalDateSerializer.class)		// 序列化
    private LocalDate meetingEndTime;

    /**
     * 文档发布时间.
     */
    @DateTimeFormat(pattern = DateHelper.DEFAULT_DATE_FORMAT)
    @JsonFormat(pattern = DateHelper.DEFAULT_DATE_FORMAT, timezone = "GMT+8")
    @JsonDeserialize(using = LocalDateDeserializer.class)		// 反序列化
    @JsonSerialize(using = LocalDateSerializer.class)		// 序列化
    private LocalDate publishTime;

    /**
     * 规定完成时间.
     */
    @DateTimeFormat(pattern = DateHelper.DEFAULT_DATE_FORMAT)
    @JsonFormat(pattern = DateHelper.DEFAULT_DATE_FORMAT, timezone = "GMT+8")
    @JsonDeserialize(using = LocalDateDeserializer.class)		// 反序列化
    @JsonSerialize(using = LocalDateSerializer.class)		// 序列化
    private LocalDate finishTime;

    /**
     * 是否需要研讨.
     */
    private Boolean isDiscuss;

    /**
     * 公司名称.
     */
    private String companyName;

    /**
     * 关键词列表.
     */
    private List<String> meetingNames;

    /**
     * 党组织.
     */
    private List<String> orgUuids;

    /**
     * 当前用户信息.
     */
    private LoginUserPojo user;
}
